package self.hoy.demo.grainmall.product.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * @author hyh
 * @date 2020/7/17
 */
@Configuration
@EnableTransactionManagement
@MapperScan("self.hoy.demo.grainmall.product.mapper")
public class ProductPaginationInterceptor {

    /**
     * 配置Mybatis分页插件
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor interceptor = new PaginationInterceptor();
        interceptor.setLimit(100);
        return interceptor;
    }
}
